﻿using MgSoft.K3Cloud.WebApi.Model;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text;

namespace MgSoft.K3Cloud.WebApi.Common.Model
{
    /// <summary>
    /// 基础资料
    /// </summary>
    public class BaseData : BaseData<MultiLanguageTextProperty>
    {

    }

    public class BaseData<T> where T : MultiLanguageTextProperty
    {
        /// <summary>
        ///  默认语言包为中文，先写死！
        /// </summary>
        public const string lcid = "2052";
        public object Id { get; set; }

        public string Number { get; set; }

        public T[] MultiLanguageText { get; set; }

        public List<KeyValuePair<string, string>> Name { get; set; }
        public string FindName()
        {
            if (Name == null || Name.Count == 0) return "";
            foreach (var item in Name)
            {
                if (item.Key == lcid) return item.Value;
            }
            return Name[0].Value;
        }
    }
}
